package model;

/**
 * CodeType.java
 * Purpose: Represents a code type in the system
 * 
 * @author Hans Brems
 * @version 1.0 31/05/2012
 */

import java.util.List;
import java.io.Serializable;
import javax.persistence.*;

@SuppressWarnings("serial")
@Entity
public class CodeType implements Serializable {
	/* Reference */
	@Id
	@Column(name="codetype_id")
	private int id;
	/* Description */
	private String description;
	
	/* Codes linked to this code type */
	@OneToMany(mappedBy="codeType")
	private List<Code> codes;
	
	/** Returns the id */
	public int getId() {
		return this.id;
	}
	
	/** Sets the id */
	public void setId(int id) {
		this.id = id;
	}
	
	/** Returns the list of codes */
	public List<Code> getCodes() {
		return this.codes;
	}
	
	/** Sets the list of codes */
	public void setCodes(List<Code> codes) {
		this.codes = codes;
	}
	
	/** Returns the description */
	public String getDescription() {
		return description;
	}
	
	/** Sets the description */
	public void setDescription(String description) {
		this.description = description;
	}
}
